package cn.mallsearch.controller;

import cn.mall.common.vo.SkuItemsVo;
import cn.mallsearch.feign.SkuInfoFeignService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.List;

@Controller

public class SearchController {
    @Autowired
    private SkuInfoFeignService service;
    @GetMapping("/search")
    public String getSearchItems(Model model){
        List<SkuItemsVo> allItems = service.getAllItems();
        model.addAttribute("items",allItems);
        return "index";
    }
}
